import request from '../utils/request';//导入帮助类里面的request对象，帮助我们发送请求给后端api接口
//部门列表
export const DepartmentList = query => {
    return request({
        url: '/api/Department ',
        method: 'get',//get请求用params
    });
};

//用户列表（用户分页组合查询）
export const getUserList = query => {
    return request({
        url: '/api/Users',
        method: 'get',//get请求用params
        params: query
    });
};

//部门添加
export const DepartmentAdd = query => {
    return request({
        url: 'api/Department/Add',
        method: 'post',//post请求用data
        data: query,
    });
};
//部门编辑
export const updateDepartment = query => {
    return request({
        url: 'api/Department/Update',
        method: 'put',
        data: query
    });
};
//部门用户添加
export const DepartmentUserAdd = query => {
    return request({
        url: 'api/Department',
        method: 'post',//post请求用data
        data: query,
    });
};
//部门用户添加
export const DepartmentUserAdd1 = query => {
    return request({
        url: 'api/Department/1',
        method: 'post',//post请求用data
        data: query,
    });
};

//部门查找
export const DepartmentQueryId = query => {
    return request({
        url: '/api/Department/' + query,
        method: 'get',//post请求用data
    });
};
//表单删除(单删)
export const DeleteDepartment = query => {
    return request({
        url: '/api/Department/?id=' + query,
        method: 'delete',
    });
};

//部门分页显示
export const DepartmentQuery = query => {
    return request({
        url: '/api/Department/DShow',
        method: 'get',//post请求用data
        params: query,
    });
};

//部门删除（批删）
export const AllDeleteDepartment = query => {
    return request({
        url: '/api/Department/AllDelete',
        method: 'delete',
        data: query,
    });
};

//刷新Token
export const fetchData = query => {
    return request({
        url: '/api/Jwt/JwtToken',
        method: 'get',//get请求用data
        params: query
    });
};